function f = assembleRHS(x)
    n = size(x, 2);
    f = zeros(n, 1);
    for i = 1:n - 1
        x0 = x(i);
        x1 = x(i + 1);
        f(i) = f(i) + quad(@phi0src, x0, x1);
        f(i + 1) = f(i + 1) + quad(@phi1src, x0, x1);
    end
end